home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / turbovis / tvtoyc01.zip / VIDEO.H < prev   
C/C++ Source or Header  |  1994-01-12  |  2KB  |  98 lines

  1. #define Uses_TCommandSet
  2.  
  3. #if !defined( __VIDEO_H)
  4. #define __VIDEO_H
  5.  
  6. #include <tv.h>
  7. #include "toycfg.h"
  8.  
  9. typedef void (*AddModeProc)(ushort mode, ushort rows, ushort columns,
  10.                    ushort charHeight, Boolean color);
  11.  
  12. /*******************************************************************
  13.   Video BIOS stuff
  14. *******************************************************************/
  15. const int    crtWidth   = 0x4A; /* byte */
  16. const int    crtSize    = 0x4C; /* word */
  17. const int    addr6845   = 0x63; /* word */
  18. const int    crtRows    = 0x84; /* byte EGA/VGA */
  19. const int    crtPoints  = 0x85; /* byte EGA/VGA */
  20. const int    crtInfo    = 0x87; /* byte EGA/VGA */
  21.  
  22. /* Use with UseInternalFont */
  23. const int    internal8x8Font  = 0x12;
  24. const int    internal8x14Font = 0x11;
  25. const int    internal8x16Font = 0x14;
  26.  
  27.  
  28. /*******************************************************************
  29.   Video mode detection stuff
  30. *******************************************************************/
  31. typedef enum {OTHER, EGA, VGA} VideoTypes;
  32. typedef enum {vtVesa=1, vtVideo7} SpecialVideoTypes;
  33.  
  34. /* This value can be used to rule out Vesa and V7 tests run-time */
  35. extern SpecialVideoTypes videoTypesToCheck;
  36.  
  37. /* Detected video type */
  38. extern VideoTypes videoType;
  39.  
  40.  
  41. #ifdef TOYVIDEO7SUPPORT
  42.  extern Boolean video7;
  43.  
  44.  const int
  45.    V7Installed = 1,
  46.    HPInstalled = 2;
  47. #endif
  48.  
  49. #ifdef TOYVESASUPPORT
  50.  extern ushort dontClearVideoModeFlag;
  51. #else
  52.  const dontClearVideoModeFlag = 0x80;
  53. #endif
  54.  
  55.  
  56. typedef class TCommandSet ModeSet;
  57.  
  58. extern ModeSet standardTextModes;
  59. extern ModeSet vgaModes;
  60. extern ModeSet vesaModes;
  61.  
  62.  
  63. /*******************************************************************
  64.   Video state object
  65. *******************************************************************/
  66. class VideoState {
  67.   ushort mode;
  68.   uchar lines;
  69.   uchar charHeight;
  70.   void save();
  71.   void restore();
  72. };
  73.  
  74.  
  75. void setSpecialVideoMode(ushort mode);
  76. ushort getSpecialVideoMode();
  77.  
  78. #ifdef TOYVESASUPPORT
  79.  void checkVesa();
  80. #endif
  81. #ifdef TOYVIDEO7SUPPORT
  82.  void checkVideo7();
  83. #endif
  84.  
  85. void checkEVGA();
  86. void checkVideoType();
  87.  
  88. int getCurrentScanLines();
  89. void useInternalFont(uchar font);
  90. void loadUserFont(uchar points, int first, int count, void *font);
  91. Boolean isProbablyTextMode();
  92. Boolean isColorMode();
  93.  
  94. void scanEVGAModes(ushort modeOffset, ModeSet modesToCheck,
  95.                    AddModeProc addMode);
  96.  
  97. #endif
  98.